//
//  ViewController.m
//  Video
//
//  Created by Burn on 2020/7/31.
//  Copyright © 2020 menksoft. All rights reserved.
//

#import "ViewController.h"
#import "RemoteView.h"
#import "Macro.h"
#import "BViewController.h"

@interface ViewController ()

@property(strong,nonatomic) RemoteView *videoView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.playerVC = YES;
    
    
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(fullScreenClick:) name:FULLSCREENCLICK object:nil];
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(backClick) name:PLAYBACK object:nil];
    
    
    
    self.videoView = [[RemoteView alloc]initWith:[NSURL URLWithString:@"http://203.57.230.154:8089/Document/resource/532603bb43e544b28365c05bf11d4581/Audios/1.MP4"] cachePolicy:NO frame:CGRectMake(0, 100, SCREEN_WIDTH , SCREEN_WIDTH * 9 / 16)];
    self.videoView.small = YES;
    self.playerView = self.videoView;
    [self.view addSubview:self.videoView];
    
    [self.videoView pause];
    
}




- (void)fullScreenClick:(NSNotification *)notification{
    
    [self fullScreenAction];
}

- (void)backClick{
    if (self.isFullScreen) {
        [self fullScreenAction];
    }else{
//        [self.navigationController popViewControllerAnimated:YES];
    }
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    BViewController *vc = [[BViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}



@end
